Purpose of getters and setters? [closed]

Posted by wrongusername on Stack Overflow See other posts from Stack Overflow or by wrongusername
Published on 2010-06-14T08:12:28Z Indexed on 2010/06/14 8:22 UTC
Read the original article Hit count: 275

Possible Duplicates:
Public Data members vs Getters, Setters
Purpose of private members in a class

What is the use of getters and setters when you can just make your variables public and avoid the hassle of such lines as A.setVariableX(A.getVariableY())?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about object-oriented-design